package com.ithiema.reflet.demo.demo3;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class Demo3 {
    public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {
        ClassLoader classLoader = Demo3.class.getClassLoader();
        InputStream resourceAsStream = classLoader.getResourceAsStream("prop.properties");
        Properties  p=new Properties();
        p.load(resourceAsStream);
        Class clazz = Class.forName(p.getProperty("className"));
        Object o = clazz.newInstance();
        Method methrodName = clazz.getDeclaredMethod(p.getProperty("methrodName"));
        methrodName.setAccessible(true);
        methrodName.invoke(o);


    }
}
